<%@ page import="cn.gudian.cms.System.SysConfig" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <title><g:message code="sysConfig.create" default="Create SysConfig"/></title>
  <script src="/js/easytabs.js?num=${SysConfig.groupIDStates.size()}" id="easyScript" data="${SysConfig.groupIDStates.size()}" type="text/javascript"></script>
</head>
<body>

<div class="body">
  <h1></h1>
  <g:if test="${flash.message}">
    <div class="message"><g:message code="${flash.message}" args="${flash.args}" default="${flash.defaultMessage}"/></div>
  </g:if>
  <g:hasErrors bean="${sysConfigInstance}">
    <div class="errors">
      <g:renderErrors bean="${sysConfigInstance}" as="list"/>
    </div>
  </g:hasErrors>
  <g:form action="updateAll" method="post">
    <div class="dialog">
      <div class="tablemenu">
        <ul>
          <g:each in="${SysConfig.groupIDStates}">
            <li><a href="#" onmouseover="easytabs('1', '${it?.key}');" onfocus="easytabs('1', '${it?.key}');" onclick="return false;" title="" id="tablink${it?.key}">【${it?.value}】</a></li>
          </g:each>

        </ul>
      </div>
      <g:each in="${SysConfig.groupIDStates}">

        <table id="tabcontent${it?.key}">
          <tbody>
          <g:each in="${SysConfig.findAllByGroupID(it?.key)}" status="i" var="sysConfigInstance">
            <tr class="prop">
              <td valign="top" class="name">
                ${fieldValue(bean: sysConfigInstance, field: "info")}:
              </td>
              <td valign="top">
                <g:if test="${sysConfigInstance?.varType=='text'}">
                       <g:textField name="${sysConfigInstance?.id}" value="${sysConfigInstance?.varValue}" style="width:100%"/>
                </g:if>
                <g:else>
                        <g:textArea name="${sysConfigInstance?.id}" value="${sysConfigInstance?.varValue}" style="height:40px;width:100%"/>
                </g:else>

              </td>
            </tr>
          </g:each>

          </tbody>
        </table>
      </g:each>

    </div>
    <div class="buttons">
      <span class="button"><g:submitButton name="create" class="save" value="修改"/></span>
    </div>
  </g:form>
</div>
</body>
</html>
